package com.andnnl.map;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * Created by chenss on 2020/4/10.
 */
public class ListToMapTest {
    public static void main(String[] args) {
        String[] strs=new String[]{"A-asdf","A-asdf2","B-asdf","C-"};
        Map<String, String> ss = Arrays.stream(strs).map((a)->a.split("-",2))
                .collect(Collectors.toMap((b) -> b[0], (b) -> b[1], (v1, v2) -> v2));
        System.out.println(ss);

    }
}
